# -*- coding: utf-8 -*-
"""
与pandas有关的索引的操作
"""
import pandas as pd


def lower_cols(data):
    '''将df或者series的列名或者索引名转成小写'''
    if type(data)==pd.core.series.Series:
        cols = [col.lower() for col in data.index]
        data.index = cols
        return data
    if type(data)==pd.core.frame.DataFrame:
        cols = [col.lower() for col in data.columns]
        data.columns = cols
        return data